Rails: Easy way to add more than one flash[:notice] at a time.

Posted by Josh Pinter on Stack Overflow See other posts from Stack Overflow or by Josh Pinter
Published on 2010-03-15T16:37:28Z Indexed on 2010/03/15 16:39 UTC
Read the original article Hit count: 278

Filed under:
|
|

I thought every time you do a flash[:notice]="Message" it would add it to the array which would then get displayed during the view but the following just keeps the last flash:

flash[:notice] = "Message 1"
flash[:notice] = "Message 2"

Now I realize it's just a simple hash with a key (I think :)) but is there a better way to do multiple flashes than the following:

flash[:notice] = "Message 1<br />"
flash[:notice] = "Message 2"

Thanks.

Josh

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about flash